package gui;

/**
 * @author Ramy Refky 
 * */
public class TSBufferComponentGraphics extends ComponentGraphics{

	private static final long serialVersionUID = 1L;
	
	/**
	 * Constructor initializes TRI-STATE BUFFER Gate by initializing ComponentGraphics, and then painting the TSBufferComponentLabel.
	 * @param MainGui, XLocation, YLocation, Width, Height , NumberOfInputs
	 * */
	public TSBufferComponentGraphics(MainGui mg,int originalXLoc,int originalYLoc,int originalWidth,int originalHeight,int numOfInputs){
		super(mg,originalXLoc,originalYLoc,originalWidth,originalHeight,2);
		
		this.remove(compLabel);
		compLabel=new TSBufferComponentLabel(newXLoc,newYLoc,originalWidth,originalHeight);
		this.add(compLabel);
		setComponentZOrder(compLabel,0);
		repaint();
	}
	@Override
	public void setInputPins(int num){
		addInputPin(getWidth()/2+10,0,getWidth()/2+4+10,getHeight()/2-4);
		addInputPin(0,getHeight()/2-1,getWidth()/2+4,getHeight()/2-1);
		repaint();
	}
	@Override
	public void adjustPins(){
		getInputPins().get(0).zoomAdjust(getWidth()/2+10,0,getWidth()/2+4+10,getHeight()/2-4);
		getInputPins().get(1).zoomAdjust(0,getHeight()/2-1,getWidth()/2+4,getHeight()/2-1);
		getOutputPin().zoomAdjust(getWidth()/2,getHeight()/2-1,getWidth(),getHeight()/2-1);
		repaint();
	}
}